package com.qf.config;



import com.qf.filter.CORSFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

@Configuration
public class WebConfig {

    @Bean
    public FilterRegistrationBean<CORSFilter> corsFilterFilterRegistrationBean() {
        FilterRegistrationBean<CORSFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(new CORSFilter());
        bean.setUrlPatterns(Arrays.asList("/*"));
        bean.setOrder(1);
        return bean;
    }
}
